<?php

class RDOStatement extends PDOStatement {

    public $rdo;

    protected function __construct($rdo) {
        $this->rdo = $rdo;
    }

    public function fetchFirst() {
        $row = $this->fetch(PDO::FETCH_NUM);
        return $row[0];
    }

    //skip reference object was passed into function of parent class
    public function bindParam($parameter, &$variable, $data_type = 'PDO::PARAM_STR', $length = null, $driver_options = null) {
        parent::bindParam($parameter, $variable);
        
    }

    public function execute( $input_parameters = null) {
        parent::execute($input_parameters);
        if (intval(parent::errorCode()) != 0) {
            $error = parent::errorInfo();
            throw new RDOException(
                    "Code: " .$error[0]. " (Driver Code: ".$error[1] . ")\r\n"
                    ."Error: " .$error[2]."\r\n"
                    .($this->queryString!=""?"Query: ".$this->queryString:"")
                    );
        }
    }

}
